package com.googlecode.wicket.soundmanager;

import org.apache.wicket.markup.html.IHeaderResponse;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.request.resource.CompressedResourceReference;
import org.apache.wicket.request.resource.ResourceReference;

public abstract class SoundManagerPanel extends Panel {

	public static final ResourceReference REFERENCE = new CompressedResourceReference(SoundManagerPanel.class,
	      "script/soundmanager2.js");

	public SoundManagerPanel(final String id) {
		super(id);
	}

	@Override
	public void renderHead(final IHeaderResponse response) {
		response.renderJavascriptReference(REFERENCE);
		response.renderOnLoadJavascript("soundManager.flashVersion = 9; 	" + "soundManager.useHighPerformance = true; "
		      + "soundManager.wmode = 'transparent'; " + "soundManager.useFastPolling = true; "
		      + "soundManager.url = '../swf/';" + "");
		response.renderOnLoadJavascript("var PP_CONFIG = {" + " autoStart : false, " + "playNext : true, "
		      + "useThrottling : false,	" + "usePeakData : true," + "useWaveformData : false, " + "useEQData : false, "
		      + "useFavIcon : false,	" + "useMovieStar : true");
	}
}
